import request from '@/utils/request'

export function pageList(queryParams) {
  return request({
    url: 'resource/pageList',
    method: 'get',
    params: queryParams
  })
}

export function save(data) {
  return request({
    url: 'resource/save',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: "resource/update",
    method: 'post',
    data
  })
}

export function detail(id) {
  return request({
    url: `resource/detail/${id}`,
    method: 'get'
  })
}

export function deleted(id) {
  return request({
    url: `resource/delete/${id}`,
    method: 'post'
  })
}

export function allUrls() {
  return request({
    url: "resource/allUrls",
    method: 'get'
  })
}

export function listIdName() {
  return request({
    url: "resource/listIdName",
    method: 'get'
  })
}

export function listAllWithRoleChecked(roleId) {
  return request({
    url: `resource/no/listAllWithRoleChecked/${roleId}`,
    method: 'get'
  })
}

